package set;

import stream.Student;

import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;

public class Test2 {
    public static void main(String[] args) {
       // Set<Student> students = new HashSet<>();
        Set<Student> students = new TreeSet<>(new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                return Double.compare(o1.getHeight(), o2.getHeight());
            }
        });



        students.add(new  Student("至尊宝", 26, 178));
        students.add(new  Student("牛魔王", 29, 175));
        students.add(new  Student("蜘蛛精", 22, 180));
        students.add(new  Student("蜘蛛精", 22, 180));

        System.out.println(students);
    }
}
